﻿var dialog;

$(onPageLoad);

function onPageLoad() {
	dialog = window.frameElement;
	$("#cmdOK").click(onCreateList);
	$("#cmdCancel").click(onCancel);
	$("#txtListTitle").focus();
}

function onCreateList() {
	var NewTitle = $("#txtListTitle").val();
	var ListType = $("input[@name=listType]:checked").val();
	dialog.commonModalDialogClose(SP.UI.DialogResult.OK,
	{ title: NewTitle, listType: ListType });
}

function onCancel() {
	dialog.commonModalDialogClose(SP.UI.DialogResult.cancel);
}